Skip to content

Conversation

@timvaillancourt
Copy link
Contributor

@timvaillancourt timvaillancourt commented Dec 19, 2025

Description

Add support for proxying FullStatus RPCs, in order for VTOrc to gain the ability to validate certain problems using many cells (locations) and detect network partitions - this will happen in future PRs (possibly v24), for now having this RPC in v24 will be helpful

Support for this is intentionally not added to vtctldclient GetFullStatus, because it's intended for internal VTOrc usage and I can't think of a good use case for someone at a CLI to need this

To add some safety, a request can only be proxied once (the ProxiedBy flag is added by the proxying tmserver) and you cannot proxy to "yourself", which would cause an infinite loop. Finally, a proxy timeout > the remote operation timeout of the proxying server returns an error. e2e tests are added to confirm these safety nets and that the proxying succeeds

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

AI Disclosure

@timvaillancourt timvaillancourt added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: VTorc Vitess Orchestrator integration Component: VTTablet labels Dec 19, 2025
@github-actions github-actions bot added this to the v24.0.0 milestone Dec 19, 2025
@vitess-bot vitess-bot bot added NeedsWebsiteDocsUpdate What it says NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Dec 19, 2025
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Dec 19, 2025

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@timvaillancourt timvaillancourt removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Dec 19, 2025
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 29.41176% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.88%. Comparing base (32b8bd8) to head (c3dce0c).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
go/vt/vttablet/grpctmserver/server.go 29.03% 22 Missing ⚠️
go/vt/vtorc/inst/tablet_dao.go 0.00% 6 Missing ⚠️
go/vt/vttablet/tabletmanager/tm_init.go 0.00% 2 Missing ⚠️
go/vt/vttablet/tmrpctest/test_tm_rpc.go 50.00% 2 Missing ⚠️
go/vt/vtcombo/tablet_map.go 0.00% 1 Missing ⚠️
go/vt/vtorc/inst/instance_dao.go 0.00% 1 Missing ⚠️
go/vt/vttablet/faketmclient/fake_client.go 0.00% 1 Missing ⚠️
go/vt/wrangler/testlib/fake_tablet.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19058      +/-   ##
==========================================
- Coverage   69.89%   69.88%   -0.02%     
==========================================
  Files        1612     1613       +1     
  Lines      215826   216058     +232     
==========================================
+ Hits       150857   150997     +140     
- Misses      64969    65061      +92     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Tim Vaillancourt <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>

func (s *server) proxyFullStatus(ctx context.Context, request *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) {
if s.tmc == nil {
return nil, vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "no proxy tabletmanger client")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The init() func of this package creates the *server with a tmclient so this situation is kind of impossible

// proxy_timeout_ms specifies the maximum number of milliseconds to wait for a
// proxied request to complete. Must be less than topo.RemoteOperationTimeout
// on the tablet proxying the request.
uint64 proxy_timeout_ms = 2;
Copy link
Member

@mattlord mattlord Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would this not be a vttime.Duration?

Comment on lines +385 to +388
// disallow timeouts larger than the local remote operation timeout
if request.ProxyTimeoutMs > uint64(topo.RemoteOperationTimeout.Milliseconds()) {
return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot set a proxy timeout ms greater than %d", topo.RemoteOperationTimeout.Milliseconds())
}
Copy link
Member

@mattlord mattlord Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure of the value of allowing the caller to specify a timeout rather than using ~ the topo.RemoteOperationTimeout / 2?

Copy link
Member

@mattlord mattlord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems OK to me, but in general I do not like intentionally adding dead/unused code. We are supposed to remove dead/unused code. 🙂

I would like to see you use this new work, in vtorc, in the same PR that you create the RPC changes. This does the following:

  1. Avoids new dead code
  2. Ensures that the underlying building blocks (RPC work in this case) actually work as needed in order to meet the larger feature/product goal. Without that we should have no confidence that this is what we need, and having to refactor it later will make things harder. Or maybe we don't even end up using it for a variety of reasons (see point 1).

Can you please implement the actual feature that you wish to add to Vitess in this PR along with the lower level RPC changes and anything else that is needed in order to implement the feature request? Then we can understand the problem, the reasons why this is an optimal solution, and confirm/demonstrate that it actually works as desired and solves the problem.

Thanks!

P.S. I think the general issue that we are trying to address here (which I have not seen laid out so I'm not sure) would typically be resolved with something like a gossip protocol. The caller having to decide if and when to proxy a request, and where to proxy it to, doesn't immediately feel to me like the best solution. But then again, I also don't see where we've clearly described the problem we want to solve and why we think this is the best solution. 🙂

@mattlord mattlord added the NeedsIssue A linked issue is missing for this Pull Request label Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: VTorc Vitess Orchestrator integration Component: VTTablet NeedsIssue A linked issue is missing for this Pull Request Type: Enhancement Logical improvement (somewhere between a bug and feature)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants